<template>
 <el-pagination
      v-model:current-page="currentPage"
      v-model:page-size="pageSize"
      background
      layout="total,prev, pager, next, jumper"
      :total="total"
      @current-change="handleCurrentChange"
      style="height: 49px;position: absolute;left:32%;transform：translateX(-50%);"
    />
</template>

<script setup>
import { onMounted,ref,toRefs } from 'vue'
//接受父组件传递的数据
const props = defineProps({
    pageSize:{
        type:Number,
        default:0
    },
    total:{
        type:Number,
        default:0
    },
})
const emit = defineEmits(['getCurrentPage']);
const {total,pageSize} = toRefs(props);

const currentPage = ref(1)

const handleSizeChange = (val) => {
  pageSize.value = val;
}
const handleCurrentChange = (val) => {
  emit(`getCurrentPage`,val)
}
</script>

<style>

</style>